package cn.wk.basic.utils;

import cn.wk.App;
import cn.wk.user.domain.LoginInfo;

import javax.servlet.http.HttpServletRequest;

public class SystemContext {
    public static LoginInfo getLoginInfo(HttpServletRequest request){
        //获取token
        String token = request.getHeader("token");
        //通过token获取当前登录对象
        LoginInfo loginInfo = (LoginInfo) App.redisTemplate().opsForValue().get(token);
        return loginInfo;
    }
}
